<template>
	<view class="w-100">
		<uni-collapse>
			<block v-for="(item, index) in newsList" :key="index">
				<uni-collapse-item :title="item.title" :titleindex="index + 1" :show-animation="true">
					<view class="flex-1 pt-1 mx-3 pb-4">
						<rich-text :nodes="item.content" class="rich-text"></rich-text>
					</view>
				</uni-collapse-item>
			</block>
		</uni-collapse>
	</view>
</template>

<script>
	import {
		newsListUrl
	} from "@/api/article.js"
	export default {
		data() {
			return {
				newsList:[],
				queryInfo: {
					category_id: 4,
					page: 1,
					page_size: 10
				},
			}
		},
		onLoad() {
			this.getNewsList()
		},
		methods: {
			getNewsList() {
				this.$R.get(newsListUrl, this.queryInfo).then(res => {
					this.newsList = res.data.list
					console.log(this.newsList);
				})
			}
		}
	}
</script>

<style lang="scss">
</style>